const app = getApp()
const config = app.data.theme

export default {
    data: {
        cropperOpt: {
            id: 'cropper',
            targetId: 'targetCropper',
            pixelRatio: 1,
            width: 720,
            height: 1100,
            scale: 2.5,
            zoom: 8,
            cut: {
                x: 10,
                y: 200,
                width: 700,
                height: 700
            },
            boundStyle: {
                color: config.active,
                mask: 'rgba(0,0,0,0.8)',
                lineWidth: 1
            }
        },
    },
    onInit() {
        this.cropperOpt.boundStyle.color = this.getThemeColor()
    },
    getThemeColor() {
        return config.items.find(item => item.name === config.active).color
    },
    uploadTap() {
        this.$child('wecropper').pushOrign('common/images/BaseAapter_test_1.PNG')
    },

    getCropperImage() {
        this.$child('wecropper').getCropperImage()
    }
}
